<?php
namespace app\admin\model;

use think\Db;

class User extends Common{
    protected $table='user';
    public function pageCom($where=[]){
        $pagesize = 2;
        return Db::name($this->table)
            ->order('b.create_time','desc')
            ->alias('a')
            ->field('a.user_id,a.user_name,a.image_thumb,b.c_id,b.title,b.create_time,b.dz')
            ->where($where)
            ->join('coment b','a.user_id=b.user_id')
            ->paginate($pagesize, false);
    }
    public function getFocus($where=[]){
        $pagesize = 2;
        return Db::name($this->table)
            ->order('b.create_time','desc')
            ->alias('a')
            ->field('a.user_id,a.user_name,a.image_thumb,b.c_id,b.title,b.create_time,b.dz,b.zhiding')
            ->where($where)
            ->join('coment b','a.user_id=b.user_id')
            ->find();
    }
}